package com.zc.designmodel.behavioral.interpreter;

/**
 * @author: zhuCan
 * @date: 2020/4/15 16:42
 * @description:
 */
public class OrExpression implements Expression {

  private Expression expression;
  private Expression orExpression;

  public OrExpression(Expression expression, Expression orExpression) {
    this.expression = expression;
    this.orExpression = orExpression;
  }

  @Override
  public boolean interpret(String context) {
    return expression.interpret(context) || orExpression.interpret(context);
  }
}
